//
//  NONavTwoViewController.m
//  DemoTest
//
//  Created by DaShuEdu on 2017/6/21.
//  Copyright © 2017年 DaShuEdu. All rights reserved.
//

#import "NONavTwoViewController.h"
#import "NONavThreeViewController.h"

@interface NONavTwoViewController ()

@end

@implementation NONavTwoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    self.navigationController.navigationBarHidden = NO;
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(100, 100, 50, 50);
    [button setTitle:@"OK" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(okAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
    button1.frame = CGRectMake(100, 150, 50, 50);
    [button1 setTitle:@"Next" forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(nextAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
}

- (void)okAction:(UIButton *)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)nextAction:(UIButton *)sender
{
    NONavThreeViewController *threeVC = [[NONavThreeViewController alloc] init];
    UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:threeVC];
    [self presentViewController:navi animated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
